#include "linklist.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

LinkList CreateLinkList(void ){
	LinkList clientList = 
		(LinkList)malloc(sizeof(LNode)); 
	if(clientList == NULL){
		printf("创建客户端列表失败, 服务器启动失败"); 
		exit(-1); 
	}
	return clientList; 
}
void deletelist(LinkList L, datatype e){
	LinkList pre = L;
	L = L->next; 
	while(L != NULL){
		if(L->data.decr = e.decr){
			LinkList temp = L ; 
			pre->next = L->next ; 
			free(temp); 
			break;
		}
		pre = L ; 
		L = L->next; 
	}
}

void insertend(LinkList L, datatype e){
	while(L->next != NULL){
		L = L->next; 
	}
	LinkList temp = (LinkList) malloc(sizeof(LNode)); 
	if(temp == NULL){
		printf("新加入客户端失败\n"); 
		exit(-1);
	}
	temp->data = e; 
	temp->next = NULL ;
	L->next = temp; 
}


